# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=hopper
pkgver=5.19.4
pkgrel=1
pkgdesc='Reverse engineering tool that lets you disassemble, decompile and debug your applications.'
groups=('blackarch' 'blackarch-reversing' 'blackarch-disassembler'
        'blackarch-decompiler' 'blackarch-binary')
arch=('x86_64')
url='https://www.hopperapp.com/download.html?'
license=('custom:unknown')
depends=('hicolor-icon-theme' 'libbsd' 'python2' 'qt5-base')
DLAGENTS=("https::/usr/bin/curl -A Mozilla -fLC - --retry 3 --retry-delay 3 -o %o %u")
source=("https://www.hopperapp.com/downloader/hopperv4/Hopper-v4-$pkgver-Linux-demo.pkg.tar.xz"
        'LICENSE')
sha512sums=('c5ac9571559e23274098a2a3135663654a775017b4cae04fa6080e7bb902d5b6cc3a509eb7d84ce430eca80e7502c249a4a184c4cb5291d3e55fabba77a4f36c'
            '8f98f63fc100f23ddf8b0e9aef9b062552d39ed48174133eea52ac7fb7d66df0da1479e6b249bae748f34fc61ee49c6cf770b03714af7c6e4b6cabf2db71b1fe')

package() {
  install -dm 755 "$pkgdir/usr/bin"

  cp -a opt usr "$pkgdir/"

  mv "$pkgdir/usr/share/doc/hopperv4" "$pkgdir/opt/hopper-v4/doc"

  # Remove launcher from Accessories
  sed -i '10s|Utility;||' "$pkgdir/usr/share/applications/hopper-v4.desktop"

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  ln -s /opt/hopper-v4/bin/Hopper "$pkgdir/usr/bin/$pkgname"
  ln -s /opt/hopper-v4/doc "$pkgdir/usr/share/doc/$pkgname"
}

